Exercise: OpenGL Transformations 2D (Solar System)

EX_OPENGL_TRANSFORMATIONS_SOLAR

Part A

  1. Draw a large yellow disk at the centre of the screen, representing the Sun.
  2. Compile and Execute.

 

Part B

  1. Modify the code in part A to all a smaller blue square ('Earth') a distance away from the 'sun'.
  2. Animate the scene to have the Earth orbit the sun.
  3. Compile and Execute.

Part C

  1. Modify the code in part B to have the Earth spin on its own axis.
  2. The Earth should spin 365 times for every orbit of the Sun.
  3. Compile and Execute.

Part D

  1. Modify the code in part C to add a small grey triangle('Moon') orbiting close to the 'Earth'
  2. The Moon should spin around the Earth once for every 28 spins of the earth.
  3. Compile and Execute.

Part D

  1. Modify the code in part D to add a red pentagon('Mars') orbiting the Sun a little further out.
  2. Mars has two small moons, add these as pixels. Have them rotate about mars.
  3. Compile and Execute.